home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TOTDEMO.ARJ / TOTDEMO.PAS < prev   
Pascal/Delphi Source File  |  1991-02-11  |  44KB  |  1,128 lines

  1. program TOTDEMO;
  2. {               Copyright 1991 TechnoJock Software, Inc.               }
  3. {                          All Rights Reserved                         }
  4. {                         Restricted by License                        }
  5.  
  6. {                             Build # 1.00                             }
  7. {$M 16000,250000,250000}
  8. {$I TOTFLAGS.INC}
  9.  
  10. {   
  11.     This is the main demo program, designed to show the capabilities 
  12.     of TechnoJock's Object Toolkit. The majority of the Toolkit demos 
  13.     are educational and illustrative, rather than flashy! This file 
  14.     combines many of the smaller demo programs and adds a touch of 
  15.     glamor. (If you're from New York, don't worry about the glamor!)
  16. }
  17.  
  18. {  COMPILATION PROBLEMS:
  19.  
  20.    Memory:  1) Enable the FINAL directive in TOTFLAGS.INC
  21.             2) Set Compile destination to disk
  22.             3) Set Link to disk
  23.             4) Set Link Mapfile off
  24.             5) Trim your config.sys and remove TSRs
  25.             6) Disable integrated and standalone debugging
  26.  
  27.             If you still have problems, run the command line 
  28.             compiler: TPC or TPCX
  29.  
  30.    File not found:   Update the Unit, Include and OBJ Options 
  31.                      Directories to point to the Toolkit
  32.                      directory.
  33.  
  34.    Unit File Format Error:  Select Compile Build to force recompilation
  35.                             of all Toolkit units.
  36.  
  37. }
  38.  
  39. uses DOS, CRT,
  40.      totSYS, totINPUT, totFAST, totWIN, totMSG, totLINK,
  41.      totLIST, totDIR, totIO1, totIO2, totIO3, totMENU,
  42.      totSTR, totDATE, totMISC,
  43.      extWIN;
  44. var  MainMenu: MoveMenuOBJ;
  45.      Choice: byte;  
  46.      SaveScreen: ScreenOBJ;
  47.  
  48. procedure Error(Line1,Line2:string);
  49. {}
  50. var PopUp:MessageOBJ;
  51. begin
  52.    with PopUp do
  53.    begin
  54.       Init(1,' Error ');
  55.       AddLine('');
  56.       AddLine(Line1);
  57.       AddLine(Line2);
  58.       AddLine('');
  59.       Show;
  60.       Done;
  61.    end;
  62. end; {Error}
  63. {||||||||||||||||||||||||||||||||||}
  64. {                                  }
  65. {     I n t r o   S c r e e n      }
  66. {                                  }
  67. {||||||||||||||||||||||||||||||||||}
  68. procedure Sparkle;
  69. {}
  70. var 
  71.   tempX,tempC:byte;
  72.   I : integer;
  73. begin
  74.    with Key do
  75.       with Screen do
  76.       begin
  77.           delay(1000);
  78.           for I := 5 to 11 do
  79.           begin
  80.               if keypressed then exit;
  81.               Attrib(5,I,78,I,yellow);
  82.               delay(75);
  83.           end;
  84.           delay(500);
  85.           for I := 13 to 18 do
  86.           begin
  87.               if keypressed then exit;
  88.               Attrib(5,I,78,I,lightgreen);
  89.               delay(75);
  90.           end;
  91.           for I := 1 to 80 do
  92.           begin
  93.               if keypressed then exit;
  94.               Attrib(I,20,I,20,lightcyan);
  95.               delay(15);
  96.           end;
  97.           repeat
  98.                tempX := Random(27);
  99.                TempC := Random(6);
  100.                Inc(TempC,9);
  101.                Attrib(27+tempX,2,27+tempX,2,TempC);
  102.                TempX := Random(40);
  103.                Attrib(20+tempX,20,20+tempX,20,TempC);
  104.                delay(50);
  105.           until Keypressed;
  106.       end;
  107. end; {Sparkle}
  108.  
  109. procedure Banner;
  110. {}
  111. var StartUp: ScreenOBJ;
  112. begin
  113.    with StartUp do
  114.    begin
  115.       Init;
  116.       Create(80,25,white);
  117.       Box(25,1,55,3,white,1);
  118.       WriteAt(27,2,7,'TechnoJock''s Object Toolkit');
  119.       WriteAT(5,5,15,'This program demonstrates the power of TechnoJock''s Object Toolkit for');
  120.       WriteAT(5,6,15,'Borland''s Turbo Pascal v5.5 and v6.0 (on IBM and true compatibles).');
  121.       WriteAT(5,7,15,'If you experience any difficulty using the product, please call or');
  122.       WriteAt(5,8,15,'write to us. More information about the Toolkit is located in the');
  123.       WriteAt(5,9,15,'README.COM file and in the documentation.');
  124.       WriteAt(5,11,15,'For further information, contact:');
  125.       WriteAt(30,13,15,'TechnoJock Software, Inc.');
  126.       WriteAt(30,14,15,'P.O. Box 820927');
  127.       WriteAT(30,15,15,'Houston, TX 77282');
  128.       WriteAT(30,17,15,'Voice (713) 493-6354');
  129.       WriteAT(30,18,15,'Fax   (713) 493-5872');
  130.       WriteCenter(23,15,'Copyright (c) 1991 TechnoJock Software, Inc.');
  131.       WriteCenter(24,15,'Restricted by License');
  132.       SlideDisplay(down);
  133.    end; 
  134.    Screen.CursOff;
  135.    Screen.WriteRight(80,25,7,'Press any key to continue...');
  136.    if not Key.Keypressed then
  137.       Screen.WriteClick(20,20,white,'"In the Software business since Tuesday"');
  138.    if Monitor^.ColorOn then
  139.       Sparkle;
  140.    Key.GetInput;
  141. end; {Banner}
  142.  
  143. procedure Introduction;
  144. {}
  145. var
  146.   PopUp: PromptOBJ;
  147.   Result: tAction;
  148. begin
  149.    Screen.Clear(white,'░'); {paint the screen}
  150.    with PopUp do
  151.    begin
  152.       Init(1,' TechnoJock''s Object Toolkit ');
  153.       AddLine('');
  154.       AddLine('   This is a demo of the Object Toolkit from   ');
  155.       AddLine('   TechnoJock Software, Inc. Please do not ');
  156.       AddLine('   run this demo while intoxicated! ');
  157.       AddLine('');
  158.       AddLine('       Would you like to see the demo? ');
  159.       AddLine('');
  160.       SetOption(1,'  Oh ~Y~es  ',89,Finished);
  161.       SetOption(2,'  Hell ~N~o  ',78,Escaped);
  162.       Result := Show;
  163.       Done;
  164.       if Result = Escaped then
  165.       begin
  166.          Writeln('Be like that!');
  167.          halt;
  168.       end;
  169.    end;
  170.    Banner;
  171. end; {Introduction}
  172. {|||||||||||||||||||||||||||||}
  173. {                             }
  174. {     M e n u   S t u f f     }
  175. {                             }
  176. {|||||||||||||||||||||||||||||}
  177. procedure SetUpMenu;
  178. {}
  179. begin
  180.    with MainMenu do
  181.    begin
  182.       Init;
  183.       SetStyleTitle(6,' TechnoJock''s Object Toolkit ');
  184.       SetMessageXY(0,24);
  185.       SetGap(5);
  186.       Win^.SetClose(false);
  187.       Win^.SetBoundary(1,1,80,23);
  188.       AddItem('');
  189.       AddFullItem(' ~I~ntroduction               ',1,73,
  190.                   'Displays a screen describing the main Toolkit features',nil);
  191.       AddFullItem(' ~F~orm Input                 ',2,70,
  192.                   'Get an idea of the power of the Toolkit''s form management facility',nil);
  193.       AddFullItem(' Display ~D~irectories        ',3,68,
  194.                   'Use the Toolkit''s directory display objects',nil);
  195.       AddFullItem(' ~B~rowse Lists, etc.         ',4,66,
  196.                   'Use the Toolkit''s browse and list objects',nil);
  197.       AddFullItem(' Display ~M~enus              ',5,77,
  198.                   'View Pull-down and Lotus-style menus',nil); 
  199.       AddFullItem(' ~S~trings and Dates          ',6,83,
  200.                   'A description of some of the other fine units!',nil);
  201.       AddFullItem(' ~H~ardware                   ',7,72,
  202.                   'Using the totSYS unit to determine system hardware',nil);
  203.       AddFullItem(' I~n~ternational Features     ',8,78,
  204.                   'A description of the Toolkit''s international aspects',nil);
  205.       AddFullItem(' ~V~iewing the "read me" file ',9,86,
  206.                   'Displays all the late breaking news about the Toolkit',nil);
  207.       AddFullItem(' ~P~rinting the documentation ',10,80,
  208.                   'Information on how to print the User''s Manual',nil);
  209.       AddFullItem(' P~u~rchasing the Toolkit     ',11,85,
  210.                   'How to buy a copy of the Toolkit', nil);
  211.       AddItem('');
  212.       AddFullItem(' ~Q~uit                       ',99,81,
  213.                   'Go do summat else',nil);
  214.    end;
  215.    Screen.PartClear(1,1,80,22,white,'░'); {paint the screen}
  216.    Screen.PartClear(1,23,80,25,30,' '); 
  217. end; {SetUpMenu}
  218. {|||||||||||||||||||||||||}
  219. {                         }
  220. {     O p t i o n    1    }
  221. {                         }
  222. {|||||||||||||||||||||||||}
  223. procedure IntroOption;
  224. {uses a scrollable virtual window to display the text}
  225. var
  226.   InfoData: ScreenOBJ;
  227.   InfoWin: VirtualWinOBJ;
  228. begin
  229.    with InfoData do
  230.    begin
  231.       Init; 
  232.       Create(80,46,71);
  233.       WriteAt(1,1,75,'What is the Object Toolkit?');
  234.       WritePlain(5,3,'TechnoJock''s Object Toolkit (or simply the Toolkit) is a library of');
  235.       WritePlain(5,4,'objects, procedures and functions for Pascal programmers. While writing');
  236.       WritePlain(5,5,'a PC program, most people spend 80% or more of their time writing the');
  237.       WritePlain(5,6,'program''s user interface, and only 20% on the "meat" of the applica-');
  238.       WritePlain(5,7,'tion. The Toolkit is designed to provide a wealth of professional user');
  239.       WritePlain(5,8,'interface tools which can eliminate up to 80% of your development work.');
  240.       WritePlain(5,9,'For example, to display a sorted directory listing in a moveable window');
  241.       WritePlain(5,10,'takes a mere three lines of code.');
  242.       WritePlain(5,12,' The interface tools include such features as efficient screen writing,');
  243.       WritePlain(5,13,'window management, menu management, full screen user input, list dis-');
  244.       WritePlain(5,14,'playing, directory listing and much more. These tools give programs a');
  245.       WritePlain(5,15,'truly professional appearance, and use the latest interface style with');
  246.       WritePlain(5,16,'pop-up dialog boxes, scroll-bars and malleable windows, all with full');
  247.       WritePlain(5,17,'mouse and keyboard support.');
  248.       WritePlain(5,19,'As well as needing a user interface, many programs have to manipulate');
  249.       WritePlain(5,20,'strings, access files, check attached hardware, and the like. The Tool-');
  250.       WritePlain(5,21,'kit also provides a rich set of routines to help with these common');
  251.       WritePlain(5,22,'tasks.');
  252.       WritePlain(5,24,'If you are new to object oriented programming, you are in luck, for the');
  253.       WritePlain(5,25,'Toolkit provides a great way for you to learn this powerful facility');
  254.       WritePlain(5,26,'without requiring that you be a rocket scientist!');
  255.       WriteAt(1,28,75,'Required Software & Hardware');
  256.       WritePlain(5,30,'The Toolkit is designed to work with v5.5 (or later) of Borland Inter-');
  257.       WritePlain(5,31,'national''s Turbo Pascal compiler for the IBM PC. To compile programs');
  258.       WritePlain(5,32,'developed using the Toolkit, you will need Turbo Pascal v5.5 or later');
  259.       WritePlain(5,33,'(or a 100% compatible Pascal compiler), and MS/PC-DOS (version 2.0 or');
  260.       WritePlain(5,34,'later).');
  261.       WriteAt(1,36,75,'Window Tips');
  262.       WriteAt(1,38,78,' - To zoom the window, click on the [] icon or press F5.');
  263.       WriteAt(1,40,78,' - To stretch the window, hold the left mouse button on the lower right');
  264.       WriteAt(1,41,78,'   corner and drag the window, or press Alt-F5 then use the cursor keys and ');
  265.       WriteAt(1,42,78,'   press Enter.');
  266.       WriteAt(1,44,78,' - To move the window, hold the left mouse button on the top of the');                     
  267.       WriteAt(1,45,78,'   window and drag the window, or press Ctrl-F5 then use the cursor keys and');                     
  268.       WriteAt(1,46,78,'   press Enter.');
  269.    end;
  270.    with Screen do
  271.    begin
  272.       PartClear(1,1,80,21,white,'░'); 
  273.       PartClear(1,22,80,25,white,' ');
  274.       WriteAt(2,23,7,'The information displayed in the window was written to a virtual screen. The');
  275.       WriteAT(2,24,7,'window can be stretched and moved. Press PgDn to see how.');
  276.    end;
  277.    with InfoWin do
  278.    begin
  279.       Init;
  280.       SetBoundary(1,1,80,22);
  281.       SetSize(4,2,77,19,1);
  282.       AssignVirtualScreen(InfoData);
  283.       Go;
  284.    end;
  285.    InfoData.Done;
  286.    InfoWin.Done;
  287. end; {IntroOption}
  288. {|||||||||||||||||||||||||}
  289. {                         }
  290. {     O p t i o n    2    }
  291. {                         }
  292. {|||||||||||||||||||||||||}
  293. procedure FormOption;
  294. {This is a copy of demIO3.pas which displays every input field type!}
  295. Var
  296.    MyList: array [1..10] of string[20];
  297.    Comments: array [1..8] of string[35];
  298.  
  299.    Str: StringIOOBJ;
  300.    Lat: LateralIOOBJ;
  301.    Pic: PictureIOOBJ;
  302.    Int: IntIOOBJ;
  303.    Rea: RealIOOBJ;
  304.    Fix: FixedRealIOOBJ;
  305.    Hx:  HexIOOBJ;
  306.    Dat: DateIOOBJ;
  307.    Check: CheckIOOBJ;
  308.    Radio: RadioIOOBJ;
  309.    WW: WWArrayIOOBJ;
  310.    Lis: ArrayIOOBJ;
  311.    AltX: HotkeyIOOBJ;
  312.    Keys: ControlkeysIOOBJ;
  313.    Strip: StripIOOBJ;
  314.    Strip3D: Strip3dIOOBJ;
  315.    Butt: ButtonIOOBJ;
  316.  
  317.    Manager: FormOBJ;
  318.    Result: tAction;
  319.  
  320. procedure FillArrays;
  321. {}
  322. begin
  323.    MyList[1] := 'French Fries';
  324.    MyList[2] := 'Baked Potato';
  325.    MyList[3] := 'Potato Salad';
  326.    MyList[4] := 'Coleslaw';
  327.    MyList[5] := 'Salad';
  328.    MyList[6] := 'Rice';
  329.    MyList[7] := 'Bark Chips';
  330.    MyList[8] := 'Tofu';
  331.    MyList[9] := 'Mixed Vegetables';
  332.    MyList[10] := 'Beer';
  333.    fillchar(Comments,sizeof(Comments),#0);
  334.    Comments[1] := 'This is the finest Pizza I have ';
  335.    Comments[2] := 'ever tasted. I also thought ';
  336.    Comments[3] := 'the head waiter was ';
  337.    Comments[4] := 'charming. ';
  338. end; {FillArrays}
  339.  
  340. procedure InitVars;
  341. {}
  342. begin
  343.    Str.Init(20,3,10);
  344.    Str.SetLabel('StringIOOBJ');
  345.    Lat.Init(20,4,20,40);
  346.    Lat.SetLabel('LateralIOOBJ');
  347.    Pic.Init(20,5,'(###) ###-####');
  348.    Pic.SetLabel('PictureIOOBJ');
  349.    Int.Init(20,6,10);
  350.    Int.SetLabel('IntIOOBJ');
  351.    Rea.Init(20,7,10);
  352.    Rea.SetLabel('RealIOOBJ');
  353.    Fix.Init(20,8,8,4);
  354.    Fix.SetLabel('FixedRealIOOBJ');
  355.    Hx.Init(20,9,5);
  356.    Hx.SetLabel('HexIOOBJ');
  357.    Dat.Init(20,10,MMDDYY);
  358.    Dat.SetLabel('DateIOOBJ');
  359.    with Check do
  360.    begin
  361.       Init(5,12,20,5,'CheckIOOBJ');
  362.       AddItem('Pepperoni',0,false);
  363.       AddItem('Mushrooms',0,true);
  364.       AddItem('Peppers',0,false);
  365.       AddItem('Dolphin',0,true);
  366.    end;
  367.    with Radio Do
  368.    begin
  369.       Init(5,18,20,4,'RadioIOOBJ');
  370.       AddItem('Thin Crust',0,false);
  371.       AddItem('Deep Pan',0,false);
  372.       AddItem('Hand Tossed!',0,true);
  373.    end;
  374.    Lis.Init(30,12,22,8,'ArrayIOOBJ');
  375.    Lis.AssignList(MyList,10,20);
  376.    WW.Init(40,6,37,5,'WWArrayIOOBJ');
  377.    WW.AssignList(Comments,8,35);
  378.    WW.WrapFull;
  379.    Strip.Init(60,13,'   ~O~K   ',Finished);
  380.    Strip.SetHotKey(280); {Alt-O}
  381.    Strip3d.Init(60,15,' ~C~ancel ',Escaped);
  382.    Strip3d.SetHotKey(302); {Alt-C}
  383.    Butt.Init(60,17,' ~B~utton ',Stop1);
  384.    Butt.SetHotKey(304); {Alt-B}
  385.    AltX.Init(301,Stop2);
  386.    Keys.Init;
  387. end; {InitVars}
  388.  
  389. begin              
  390.    with Screen do
  391.    begin
  392.       TitledBox(1,1,80,23,76,79,78,2,' The Works! ');
  393.       WriteCenter(23,79,'Press TAB to switched fields and press ESC or F10 to end');
  394.       PartClear(1,24,80,25,23,' ');
  395.       WritePlain(5,24,'This demo shows many of the different form input field types. Run the');
  396.       WritePlain(5,25,'demo programs DEMIO21, DEMIO22, DEMIO23 for some more powerful examples!');
  397.    end;
  398.    FillArrays;
  399.    InitVars;
  400.    with Manager do
  401.    begin
  402.       Init;
  403.       AddItem(Keys);
  404.       AddItem(Str);
  405.       AddItem(Lat);
  406.       AddItem(Pic);
  407.       AddItem(Int);
  408.       AddItem(Rea);
  409.       AddItem(Fix);
  410.       AddItem(Hx);
  411.       AddItem(Dat);
  412.       AddItem(Check);
  413.       AddItem(Radio);
  414.       AddItem(Lis);
  415.       AddItem(WW);
  416.       AddItem(Strip);
  417.       AddItem(Strip3d);
  418.       AddItem(Butt);
  419.       AddItem(AltX);
  420.       Mouse.Show;
  421.       Key.SetDouble(False);
  422.       Result := Go;
  423.    end;
  424. end; {FormOption}
  425. {|||||||||||||||||||||||||}
  426. {                         }
  427. {     O p t i o n    3    }
  428. {                         }
  429. {|||||||||||||||||||||||||}
  430. procedure DirectoryOption;
  431. {}
  432. var
  433.   PopUp: MessageOBJ;
  434.   DirOne: ListDirSortOBJ;
  435.   DirTwo: DirWinOBJ;
  436.   Result: tAction;
  437.   X1,Y1,X2,Y2,Style:byte;
  438. begin
  439.    Screen.PartClear(1,1,80,21,white,'░'); 
  440.    Screen.PartClear(1,22,80,25,white,' ');
  441.    with PopUp do
  442.    begin
  443.       Init(1,' Directory Listings ');
  444.       AddLine('');
  445.       AddLine(' The Toolkit provides two different objects for');
  446.       AddLine(' displaying directories. The ListDirOBJ family of');
  447.       AddLine(' objects displays files in a multi-column list, and');
  448.       AddLine(' the user may optionally select multiple files. The ');
  449.       AddLine(' DirWinOBJ is designed to choose a single file.');
  450.       AddLine('');
  451.       AddLine(' Both object types will be demonstrated.');
  452.       AddLine('');
  453.       Show;
  454.       Done;
  455.    end;
  456.    with Screen do
  457.    begin
  458.       WriteAt(7,23,7,'Select multiple files by clicking the mouse or pressing the space bar.');
  459.       WriteAT(7,24,7,'Change directories by selecting a subdirectory or ''..''. F10 to quit.');
  460.    end;
  461.    with DirOne do
  462.    begin
  463.       Init;
  464.       ReadFiles('*.*',anyfile);
  465.       Win^.SetTitle(' Press S or Right Button for Sort Options ');
  466.       Go;
  467.       Win^.Remove;
  468.       Done;
  469.    end;
  470.    with Screen do
  471.    begin
  472.       PartClear(1,22,80,25,white,' ');
  473.       WriteAt(7,23,7,'Press TAB to change fields. Enter a file name or mask, select a file');
  474.       WriteAT(7,24,7,'from the list or change directories by double-clicking or press Enter.');
  475.    end;
  476.    with DirTwo do
  477.    begin
  478.       Init;
  479.       Win^.GetSize(X1,Y1,X2,Y2,Style);
  480.       Win^.SetSize(X1,1,X2,Y2-pred(Y1),Style);
  481.       Result := Go;
  482.       Done;
  483.    end;
  484. end; {DirectoryOption}
  485. {|||||||||||||||||||||||||}
  486. {                         }
  487. {     O p t i o n   4     }
  488. {                         }
  489. {|||||||||||||||||||||||||}
  490. procedure BrowseListOption;
  491. {}
  492. var 
  493.   Filename:string;
  494.   Filer: BrowseFileOBJ;
  495.   ListWin: ListLinkOBJ;
  496.   ItemList: StrDLLOBJ;
  497.   F:text;
  498.   Line:string;
  499.   Result: integer;
  500. begin
  501.    Screen.PartClear(1,1,80,22,white,'░'); 
  502.    Screen.PartClear(1,23,80,25,white,' ');
  503.    if exist('totdemo.pas') then
  504.       Filename := 'totdemo.pas'
  505.    else if exist('c:\autoexec.bat') then
  506.       Filename := 'c:\autoexec.bat'
  507.    else
  508.      Filename := '';
  509.    if Filename <> '' then
  510.       with Filer do
  511.       begin
  512.         Init;
  513.         Result := AssignFile(Filename);
  514.         Win^.SetBoundary(1,1,80,23);
  515.         Win^.SetSize(10,3,70,18,1);
  516.         Screen.WriteAT(10,24,7,'The Toolkit can browse string arrays, linked lists, and text files.');
  517.         Screen.WriteAT(10,25,7,'In this case, the file '+filename+' is being browsed.');
  518.         Go;
  519.         Done;
  520.       end
  521.    else
  522.      Error(' The file browse demo cannot locate totdemo.pas',
  523.            ' or c:\autoexec.bat. Too bad, it''s a great demo! ');
  524.    {Now the list demo}
  525.    Screen.PartClear(1,23,80,25,white,' ');
  526.    if exist('demls4.txt') then
  527.       with ItemList do
  528.       begin
  529.          Init;
  530.          {$I-}
  531.          Assign(F,'demls4.txt');
  532.          Reset(F);
  533.          {$I+}
  534.          if not IOResult = 0 then
  535.             Result := Add('File not found')
  536.          else
  537.          begin
  538.             while not eof(F) do
  539.             begin
  540.                Readln(F,Line);
  541.                Result := Add(Line);
  542.             end;
  543.             close(F);
  544.          end;
  545.          with ListWin do
  546.          begin
  547.             Init;
  548.             AssignList(ItemList);
  549.             SetColWidth(15);
  550.             Win^.SetTitle(' Items from file DEMLS4.TXT ');
  551.             Win^.SetSize(10,3,72,18,1);
  552.             Win^.SetBoundary(1,1,80,23);
  553.             Screen.WriteAT(5,24,7,'The Toolkit can list string arrays and linked lists in multiple columns.');
  554.             Screen.WriteAT(5,25,7,'In this case, a 500 item linked list is being displayed.');
  555.             Go;
  556.             ListWin.Done;
  557.          end;
  558.          ItemList.Done;
  559.       end
  560.    else
  561.      Error(' The list demo routine cannot locate demls4.txt. ',
  562.            ' Too bad, it''s a great demo!');
  563. end; {BrowseListOption}
  564. {|||||||||||||||||||||||||}
  565. {                         }
  566. {     O p t i o n   5     }
  567. {                         }
  568. {|||||||||||||||||||||||||}
  569. procedure PopUpMenu;
  570. {}
  571. var Msg:MessageOBJ;
  572. begin
  573.    with Msg do
  574.    begin
  575.       Init(1,' Pop-Up Menus ');
  576.       AddLine('');
  577.       AddLine(' You are using pop-up menus right now!');
  578.       AddLine(' Pop-up menus are single menu lists which ');
  579.       AddLine(' can be displayed on static or moveable');
  580.       AddLine(' windows. Run the demos DEMMN1, DEMMN2 and ');
  581.       AddLine(' DEMMN3 for further examples.');
  582.       AddLine('');
  583.       Show;
  584.       Done;
  585.    end;
  586. end; {PopUpMenu}
  587.  
  588. procedure LotusMenu;
  589. {}
  590. var
  591.   Main,
  592.   Worksheet,
  593.   Range: LotusMenuOBJ;
  594.   Choice: word;
  595.  
  596.   procedure Pretend;
  597.   begin
  598.      Screen.Clear(31,' '); {paint the screen}
  599.      Screen.WriteAt(1,4,48,replicate(80,' '));
  600.      Screen.WriteCenter(4,48,'Not 1-2-3!');
  601.      Screen.PartClear(1,5,4,25,48,' ');
  602.   end; {Pretend}
  603.  
  604. begin
  605.    Pretend;
  606.    with Worksheet do
  607.    begin
  608.       Init;
  609.       AddFullItem('~G~lobal',100,71,'Global stuff',nil);
  610.       AddFullItem('~I~nsert',101,73,'Insert stuff',nil);
  611.       AddFullItem('~D~elete',102,68,'Delete stuff',nil);
  612.       AddFullItem('~C~olumn',103,67,'Column stuff',nil);
  613.       AddFullItem('~E~rase',104,69,'Erase stuff',nil);
  614.       AddFullItem('~T~itles',105,84,'Titles stuff',nil);
  615.       AddFullItem('~W~indow',106,87,'Window stuff',nil);
  616.       AddFullItem('~S~tatus',107,83,'Status stuff',nil);
  617.       AddFullItem('~P~age',108,80,'Page stuff',nil);
  618.       AddFullItem('~H~ide',109,72,'Hide things',nil);
  619.       SetActiveItem(1);
  620.       SetGap(1);
  621.    end;
  622.    with Range do
  623.    begin
  624.       Init;
  625.       AddFullItem('~F~ormat',200,70,'Format stuff',nil);
  626.       AddFullItem('~L~abel',201,76,'Label stuff',nil);
  627.       AddFullItem('~E~rase',202,69,'Erase stuff',nil);
  628.       AddFullItem('~N~ame',203,78,'Name stuff',nil);
  629.       AddFullItem('~J~ustify',204,74,'Justify stuff',nil);
  630.       AddFullItem('~P~rot',205,80,'Protect stuff',nil);
  631.       AddFullItem('~U~nprot',206,85,'Unprotect stuff',nil);
  632.       AddFullItem('~I~nput',207,73,'Input stuff',nil);
  633.       AddFullItem('~V~alue',208,86,'Value stuff',nil);
  634.       AddFullItem('~T~rans',209,84,'Transpose stuff',nil);
  635.       AddFullItem('~S~earch',209,83,'Search for things',nil);
  636.       SetActiveItem(1);
  637.       SetGap(1);
  638.    end;
  639.    with Main do
  640.    begin
  641.       Init;
  642.       AddFullItem('~W~orksheet',1,87,'Worksheet and global operations',@Worksheet);
  643.       AddFullItem('~R~ange',2,82,'Commands for manipulating data ranges',@Range);
  644.       AddFullItem('~C~opy',3,67,'Cell and range copying commands',nil);
  645.       AddFullItem('~M~ove',4,77,'Cell and range moving commands',nil);
  646.       AddFullItem('~F~ile',5,70,'File loading and saving operations',nil);
  647.       AddFullItem('~P~rint',6,80,'Graph and spreadsheet printing',nil);
  648.       AddFullItem('~G~raph',7,71,'Spreadsheet charting',nil);
  649.       AddFullItem('~D~ata',8,68,'Database operations',nil);
  650.       AddFullItem('~S~ystem',9,83,'Drop to the Operating System',nil);
  651.       AddFullItem('~Q~uit',99,81,'Miller Time!',nil);
  652.       SetActiveItem(1);
  653.       SetGap(1);
  654.       Choice := Activate;
  655.       Done;
  656.       Worksheet.Done;
  657.       Range.Done;
  658.    end;
  659. end; {LotusMenu}
  660.  
  661. procedure PullDownMenu;
  662. {}
  663. var
  664.   Env,Watch: MenuOBJ;
  665.   Menu: EZPullArrayOBJ;
  666.   Choice: word;
  667.  
  668.    procedure CreateSubMenus;
  669.    {}
  670.    begin
  671.       with Env do 
  672.       begin
  673.          Init;
  674.          SetForPull;
  675.          AddFullItem(' ~P~references... ',8061,80,'Specify desktop settings',nil);
  676.          AddFullItem(' ~E~ditor...      ',8062,69,'Specify editor settings',nil);
  677.          AddFullItem(' ~M~ouse...       ',8063,77,'Specify mouse settings',nil);
  678.          AddFullItem(' ~S~tartup...     ',8064,83,'Permanently change default startup options',nil);
  679.          AddFullItem(' ~C~olors...      ',8065,67,'Customize IDE colors for windows, menus, etc.',nil);
  680.       end;
  681.       with Watch do
  682.       begin
  683.          Init;
  684.          SetForPull;
  685.          AddFullItem(' ~A~dd watch...       ',7021,65,'Insert a watch expression into the Watch window',nil);
  686.          AddFullItem(' ~D~elete watch       ',7022,68,'Remove the current watch expression from the Watch window',nil);
  687.          AddFullItem(' ~E~dit watch...      ',7023,69,'Edit the current watch expression in the Watch window',nil);
  688.          AddFullItem(' ~R~emove all watches ',7024,82,'Delete all watch expressions from the Watch window',nil);
  689.       end;
  690.    end; {CreateSubMenus}
  691.    
  692.    procedure CreateMenu;
  693.    {}
  694.    var
  695.      Mtxt: Array[1..84] of string[100];
  696.    begin
  697.       MTxt[1] := '\ ≡ "System Commands';
  698.       MTxt[2] := ' ~A~bout...        "Show version and copyright information"100';
  699.       MTxt[3] := ' ~R~efresh display "Redraw the screen"101';
  700.       MTxt[4] := ' ~C~lear desktop   "Close all windows on the desktop, clear history lists"102';
  701.       MTxt[5] := '\ ~F~ile "File management commands (Open, New, Save, etc.)';
  702.       MTxt[6] := ' ~O~pen...   F3  "Locate and open a file in an edit window"201"317';
  703.       MTxt[7] := ' ~N~ew           "Create a new file in a new Edit window"202';
  704.       MTxt[8] := ' ~S~ave      F2  "Save the file in the active Edit window"203"316';
  705.       MTxt[9] := ' S~a~ve as...    "Save the current file under a different name"204';
  706.       MTxt[10] := ' Save a~l~l      "Save all modified files"205';
  707.       MTxt[11] := '-';
  708.       MTxt[12] := ' ~C~hange dir... "Choose a new default directory"206';
  709.       MTxt[13] := ' ~P~rint         "Print the contents of the active Edit window"207';
  710.       MTxt[14] := ' ~G~et info...   "Show status information"208';
  711.       MTxt[15] := ' ~D~OS shell     "Temporarily exit to DOS"209';
  712.       MTxt[16] := ' E~x~it          "Exit Turbo Pascal"9999';
  713.       MTxt[17] := '\ ~E~dit "Cut-and-paste editing commands"';
  714.       MTxt[18] := '_ ~R~estore line     "Cancel edits to the current line in active Edit window"301';
  715.       MTxt[19] := '-';
  716.       MTxt[20] := '_ Cu~t~    Shift-Del "Remove the selected text and put it in the Clipboard"302';
  717.       MTxt[21] := '_ ~C~opy    Ctrl-Ins "Copy the selected text into the Clipboard"303"9999';
  718.       MTxt[22] := '_ ~P~aste  Shift-Ins "Insert selected text from the Clipboard"304"291';
  719.       MTxt[23] := '_ Copy e~x~ample     "Copy example from the Help window into the ClipBoard"305';
  720.       MTxt[24] := ' ~S~how clipboard   "Open the Clipboard window"306';
  721.       MTxt[25] := '-';
  722.       MTxt[26] := '_ C~l~ear   Ctrl-Del "Delete the selected text"307"262';
  723.       MTxt[27] := '\ ~S~earch "Text and error search commands';
  724.       MTxt[28] := ' ~F~ind...             "Search for text"401';
  725.       MTxt[29] := ' ~R~eplace...          "Search for text and replace it with new text"402';
  726.       MTxt[30] := ' ~S~earch again        "Repeat the last Find or Replace command"403';
  727.       MTxt[31] := ' ~G~oto line number... "Move the cursor to a specified line number"404';
  728.       MTxt[32] := ' ~F~ind procedure...   "Search for a procedure or function while debugging"405';
  729.       MTxt[33] := ' Find e~r~ror...       "Move the cursor to the position of a runtime error"406';
  730.       MTxt[34] := '\ ~R~un "Execute or single-step through a program';
  731.       MTxt[35] := ' ~R~un            Ctrl-F9 "Run the current program"501"358';
  732.       MTxt[36] := '_ ~P~rogram reset  Ctrl-F2 "Halt debugging session and release memory"502"351';
  733.       MTxt[37] := ' ~G~o to cursor        F4 "Run program from the run bar to the cursor position"503"318';
  734.       MTxt[38] := ' ~T~race into          F7 "Execute next statement, stopping within the current proc"504"321';
  735.       MTxt[39] := ' ~S~tep over           F8 "Execute next statement, skipping over the current proc"505"322';
  736.       MTxt[40] := ' P~a~rameters...          "Set command line parameters to be passed to the program"506';
  737.       MTxt[41] := '\ ~C~ompile "Compile to disk or memory';
  738.       MTxt[42] := ' ~C~ompile  Alt-F9 "Compile source file"601"368';
  739.       MTxt[43] := ' ~M~ake         F9 "Rebuild source file and all modified files"602"323';
  740.       MTxt[44] := ' ~B~uild           "Rebuild source file and all files"603';
  741.       MTxt[45] := ' ~D~estination     "Specify whether file is compiled to memory or disk"604';
  742.       MTxt[46] := ' ~P~rimary file... "Define the file that is the focus of make and Build"605';
  743.       MTxt[47] := '\ ~D~ebug "Evaluate expressions, modify data, set breakpoints and watches';
  744.       MTxt[48] := ' ~E~valute/modify...  Ctrl-F4 "Evaluate a variable or expression and display or modify the value"701"353';
  745.       MTxt[49] := ' ~W~atches                   "Add, delete and edit expressions in the watch window"702';
  746.       MTxt[50] := ' ~T~oggle breakpoint  Ctrl-F8 "Set or clear an unconditional breakpoint at the cursor position"703"357';
  747.       MTxt[51] := ' ~B~reakpoints...    "Set conditional breakpoints, view and edit breakpoints"704';
  748.       MTxt[52] := '\ ~O~ptions "Set defaults for compiler, editor, mouse, debugger, etc.';
  749.       MTxt[53] := ' ~C~ompiler            "Set default compiler directives and condl. defines"801';
  750.       MTxt[54] := ' ~M~emory sizes...     "Set default stack and heap sizes for generated programs"802';
  751.       MTxt[55] := ' ~L~inker...           "Set linker options"803';
  752.       MTxt[56] := ' De~b~ugger...         "Set debugger options"804';
  753.       MTxt[57] := ' ~D~irectories...      "Set paths for units, include files, OBJs anfd generated files"805';
  754.       MTxt[58] := '-';
  755.       MTxt[59] := ' ~E~nvironment        "Specify environment settings"806';
  756.       MTxt[60] := '-';
  757.       MTxt[61] := ' ~S~ave options...     "Save all the settings you''ve made in the Options menu"807';
  758.       MTxt[62] := ' ~R~etrieve options... "Load options file previously created with Save Options"808';
  759.       MTxt[63] := '\ ~W~indow "Open, arrange, and list windows';
  760.       MTxt[64] := ' ~S~ize/Move   Ctrl-F5 "Change the size or position of the active window"901"354';  
  761.       MTxt[65] := ' ~Z~oom             F5 "Enlarge or restore the size of the active window"902"319';
  762.       MTxt[66] := ' ~T~ile                "Arrange windows on desktop by tiling"903';
  763.       MTxt[67] := ' C~a~scade             "Arrange windows on desktop by cascading"904';
  764.       MTxt[68] := ' ~N~ext             F6 "Make the next window active"905"320';
  765.       MTxt[69] := ' ~P~revious   Shift-F6 "Make the previous window active"906"345';
  766.       MTxt[70] := ' ~C~lose        Alt-F3 "Close the active window"907"362';
  767.       MTxt[71] := '-';
  768.       MTxt[72] := ' ~W~atch               "Open the watch window"908';
  769.       MTxt[73] := ' ~R~egister            "Open the Register window"909';
  770.       MTxt[74] := ' ~O~utput              "Open the Output window"910';
  771.       MTxt[75] := ' Call stac~k~  Ctrl-F3 "Show the procedures the program called to reach this point"911"352';
  772.       MTxt[76] := ' ~U~ser screen  Alt-F5 "Switch to the full-screen user output"912"364';
  773.       MTxt[77] := '-';
  774.       MTxt[78] := ' ~L~ist...       Alt-0 "Show a list of all open windows"913"385';
  775.       MTxt[79] := '\ ~H~elp "Get online help';
  776.       MTxt[80] := ' ~C~ontents               "Show table of contents of online Help"1001';
  777.       MTxt[81] := ' ~I~ndex         Shift-F1 "Show index for online Help"1002"340';
  778.       MTxt[82] := ' ~T~opic Search   Ctrl-F1 "Display help on the word at the cursor"1003"350';
  779.       MTxt[83] := ' ~P~revious Topic  Alt-F1 "Redisplay the last-viewed online Help screen"1004"360';
  780.       MTxt[84] := ' ~H~elp on Help           "How to use online Help"1005';
  781.       with Menu do
  782.       begin
  783.          Init;
  784.          AssignList(MTxt,84,100);
  785.       end;
  786.    end; {CreateMenu}
  787.  
  788. begin
  789.    Screen.PartClear(1,2,80,24,white,'░'); {paint the screen}
  790.    Screen.PartClear(1,1,80,1,31,' ');
  791.    Screen.PartClear(1,25,80,25,31,' ');
  792.    Screen.WritePlain(9,25,'│');
  793.    CreateMenu;
  794.    CreateSubMenus;
  795.    with Menu do
  796.    begin
  797.       SubMenu(7)^.SetSubMenu(2,@Watch);
  798.       SubMenu(8)^.SetSubMenu(7,@Env);
  799.       Choice := Push(289,0,0);   {Pass Alt-F to make menu pull down on File}
  800.       Done;
  801.       Env.Done;
  802.       Watch.Done;
  803.    end;
  804. end; {PullDownMenu}
  805.  
  806. procedure MenuOption;
  807. {}
  808. var
  809.   MenuScreen: ScreenOBJ;
  810.   SubMenu: MoveMenuOBJ;
  811.   Choice: Integer;
  812. begin
  813.    Screen.Attrib(1,1,80,22,lightgray);
  814.    MenuScreen.Init;
  815.    MenuScreen.Save;
  816.    with Submenu do
  817.    begin
  818.       Init;
  819.       AddItem('');
  820.       AddFullItem(' ~P~op-Up Menus        ',1,80,'Describes Pop-Up menus',nil);
  821.       AddFullItem(' ~L~otus-style Menus   ',2,76,'Displays a Lotus-style menu',nil);
  822.       AddFullItem(' P~u~ll-down Menus     ',3,85,'Display an IDE style pull-down menu',nil);
  823.       AddItem('');
  824.       AddFullItem(' ~R~eturn to main menu ',99,82,'Leave the menu section',nil);
  825.       SetMenuXY(40,12);
  826.       SetGap(10);
  827.       Win^.SetClose(false);
  828.       Win^.SetBoundary(1,1,80,23);
  829.       repeat
  830.          MenuScreen.Display;
  831.          Choice := Activate;
  832.          MenuScreen.Save;
  833.          Screen.ResetWindow;
  834.          case Choice of
  835.             1:PopUpMenu;
  836.             2:LotusMenu;
  837.             3:PullDownMenu;
  838.          end; {case}
  839.       until Choice in [0,99];
  840.       MenuScreen.Done;
  841.       Done;
  842.    end;
  843.    Mouse.Show;
  844. end; {MenuOption}
  845. {|||||||||||||||||||||||||}
  846. {                         }
  847. {     O p t i o n   6     }
  848. {                         }
  849. {|||||||||||||||||||||||||}                               
  850. procedure StringDateOption;
  851. {}
  852. var DemoStr:string;
  853. begin 
  854.    with Screen do
  855.    begin
  856.       TitledBox(1,1,80,25,27,30,23,2,' String and Date and Units ');
  857.       WritePlain(3,3,'There are too many units to describe in detail in this demo program.');
  858.       WritePlain(3,4,'However, listed below are some examples which take advantage of the');
  859.       WritePlain(3,5,'Toolkit''s string and date units:');
  860.       DemoStr := '  TechnoJock''s Object Toolkit string demo   ';
  861.       WriteAt(5,7,23,'Source String: ');
  862.       WriteAt(30,7,27,'"'+DemoStr+'"');
  863.       WriteAt(3,9,23,'SetUpper:');
  864.       WriteAt(30,9,30,'"'+SetUpper(DemoStr)+'"');
  865.       WriteAt(3,10,23,'SetLower:');
  866.       WriteAt(30,10,30,'"'+SetLower(DemoStr)+'"');
  867.       WriteAt(3,11,23,'SetProper:');
  868.       WriteAt(30,11,30,'"'+SetProper(DemoStr)+'"');
  869.       WriteAt(3,12,23,'Total words:');
  870.       WriteAt(30,12,lightgreen,IntToStr(WordCnt(DemoStr)));
  871.       WriteAt(3,13,23,'Posn. Word 3:');
  872.       WriteAt(30,13,lightgreen,IntToStr(PosWord(3,DemoStr)));
  873.       WriteAt(3,14,23,'Words 3..5 are:');
  874.       WriteAt(30,14,30,'"'+ExtractWords(3,3,DemoStr)+'"');
  875.       WriteAt(3,15,23,'Strip Leading spaces:');
  876.       WriteAt(30,15,30,'"'+Strip('L',' ',DemoStr)+'"');
  877.       WriteAt(3,16,23,'Strip Trailing spaces:');
  878.       WriteAt(30,16,30,'"'+Strip('R',' ',DemoStr)+'"');
  879.       WriteAt(3,17,23,'Strip Lng. & Tng. spaces:');
  880.       WriteAt(30,17,30,'"'+Strip('B',' ',DemoStr)+'"');
  881.       WriteAt(3,18,23,'Strip All spaces:');
  882.       WriteAt(30,18,30,'"'+Strip('A',' ',DemoStr)+'"');
  883.       WriteAt(3,20,27,'Today is: '+FancyDateStr(TodayInJul,true,true));
  884.       WriteAt(3,21,27,'The start of the year is '+JulToStr(StartOfYear(TodayInJul),MMDDYYYY));
  885.       WriteAt(3,22,27,'The end of the year is '+JulToStr(EndOfYear(TodayInJul),MMDDYYYY));
  886.       WriteAt(3,23,27,'30 days from now is '+FancydateStr(TodayInJul+30,true,true));
  887.       WriteRight(78,25,27,' Press any key to continue ... ');
  888.    end;
  889.    Key.GetInput;
  890. end; {StringDateOption}
  891. {|||||||||||||||||||||||||}
  892. {                         }
  893. {     O p t i o n   7     }
  894. {                         }
  895. {|||||||||||||||||||||||||}
  896. procedure HardwareOption;
  897. {}
  898. var 
  899.   PopUp:MessageOBJ;
  900.   Equip: EquipOBJ;
  901. begin
  902.    with PopUp do
  903.    begin
  904.       Init(1,' Hardware ');
  905.       AddLine('');
  906.       AddLine(' The totSYS unit provides information about the hardware ');
  907.       AddLine(' installed on the host computer. Listed below is some of ');
  908.       AddLine(' the information available about your computer: ');
  909.       AddLine('');
  910.       if Monitor^.ColorOn then
  911.          AddLine('          This system is color')
  912.       else
  913.          AddLine('          This system is monochrome');
  914.       with Equip do
  915.       begin
  916.          Init;
  917.          AddLine('          Machine ID: '+inttostr(ComputerID));
  918.          AddLine('          Parallel Ports: '+inttostr(ParallelPorts));
  919.          AddLine('          Serial Ports: '+inttostr(SerialPorts));
  920.          AddLine('          Floppy Drives: '+inttostr(Floppydrives));
  921.          AddLine('          ROM date: '+RomDate);
  922.          if GameAdapter then
  923.             AddLine('          Game Adapter: TRUE')
  924.          else
  925.             AddLine('          Game Adapter: FALSE');
  926.          if SerialPrinter then
  927.             AddLine('          Serial printer: TRUE')
  928.          else
  929.             AddLine('          Serial printer: FALSE');
  930.          if MathChip then
  931.             AddLine('          Math Coprocessor: TRUE')
  932.          else
  933.             AddLine('          Math Coprocessor: FALSE');
  934.          Equip.Done;
  935.       end;
  936.       AddLine('');
  937.       SetOption('  ~S~mart Huh!  ',83);
  938.       Show;          
  939.       Done;
  940.    end;
  941. end; {HardwareOption}
  942. {|||||||||||||||||||||||||}
  943. {                         }
  944. {     O p t i o n   8     }
  945. {                         }
  946. {|||||||||||||||||||||||||}
  947. procedure InternationalOption;
  948. {}
  949. var 
  950.   OS: OSOBJ;
  951.   Str:string;
  952. begin
  953.    with Screen do
  954.    begin
  955.       TitledBox(1,1,80,25,27,30,23,2,' String and Date and Units ');
  956.       WritePlain(3,3,'Many international users have helped us to make the Toolkit useful in');
  957.       WritePlain(3,4,'non-English speaking countries (including Australia!). Listed below');
  958.       WritePlain(3,5,'are some of the international-related features:');
  959.       WriteAT(3,7,31,'DOS Settings');
  960.       WritePlain(7,8,'The totSYS unit includes OSOBJ for determining the DOS configuration.');
  961.       WritePlain(7,9,'Listed below are some of the items about your system:');
  962.       with OS do
  963.       begin
  964.          Init;
  965.          WriteAt(20,10,30,'Operating System Version: '+OSversion);
  966.          WriteAt(20,11,30,'Country Code: '+inttostr(Country));
  967.          Str := 'Currency String: '+Currency+' ';
  968.          case CurrencyFmt of
  969.             0: Str := Str+'(String leads currency, no space)';
  970.             1: Str := Str+'(String follows currency, no space)';
  971.             2: Str := Str+'(String leads currency, one space)';
  972.             3: Str := Str+'(String follows currency, one space)';
  973.             4: Str := Str+'(String replaces decimal separator)';
  974.          end; {case}
  975.          WriteAT(20,12,30,Str);
  976.          WriteAT(20,13,30,'Currency Decimal Places: '+inttostr(CurrencyDecPlaces));
  977.          WriteAT(20,14,30,'Thousands Separator: '''+ThousandsSep+'''');
  978.          WriteAT(20,15,30,'Decimal Separator: '''+DecimalSep+'''');
  979.          case DateFmt of
  980.             USA: WriteAT(20,16,30,'Date Format: MM DD YY');
  981.             Europe: WriteAT(20,16,30,'Date Format: DD MM YY');
  982.             Japan: WriteAT(20,16,30,'Date Format: YY MM DD');
  983.          end; {case}
  984.          Done;
  985.       end;
  986.       WriteAT(3,17,31,'KeyBoard Input');
  987.       WritePlain(7,18,'All characters may be entered including extended ASCII characters.');
  988.       WritePlain(7,19,'The totINPUT unit provides objects for controlling which characters');
  989.       WritePlain(7,20,'are upper- and lower-case, as well as letting you control how their');
  990.       WritePlain(7,21,'case is changed. You can even change the days and months to another lang.');
  991.       WriteAT(3,22,31,'Toolkit Messages');
  992.       WritePlain(7,23,'The messages displayed to users during input validation can be ');
  993.       WritePlain(7,24,'customized for any language. Refer to the README file for more info.');
  994.       WriteRight(78,25,27,' Press any key to continue ... ');
  995.    end;
  996.    Key.GetInput;
  997. end; {InternationalOption}
  998. {|||||||||||||||||||||||||}
  999. {                         }
  1000. {     O p t i o n   9     }
  1001. {                         }
  1002. {|||||||||||||||||||||||||}
  1003. procedure ReadmeOption;
  1004. {}
  1005. var 
  1006.  Filename:string;
  1007.  Retcode : integer;
  1008. begin
  1009.    if exist('README.COM') then
  1010.       filename :=  'README.COM'
  1011.    else if exist('..\tot\README.COM') then
  1012.       filename :=  '..\tot\README.COM'
  1013.    else
  1014.       filename := '';
  1015.    if filename <> '' then
  1016.       Retcode := RunEXECOM(filename,'')
  1017.    else
  1018.       Error(' Argh! I cannot locate the file README.COM. Exit to ',
  1019.             ' DOS, find the file and execute it manually');
  1020. end; {ReadmeOption}
  1021. {|||||||||||||||||||||||||}
  1022. {                         }
  1023. {     O p t i o n   10    }
  1024. {                         }
  1025. {|||||||||||||||||||||||||}
  1026. procedure PrintOption;
  1027. {}
  1028. var
  1029.    PopUp:MessageOBJ;
  1030. begin
  1031.    with PopUp do
  1032.    begin
  1033.       Init(1,' Printing the Documentation ');
  1034.       AddLine('');
  1035.       AddLine(' If you have not yet purchased the Toolkit, you might');
  1036.       AddLine(' want to print the documentation to help you evaluate ');
  1037.       AddLine(' the product. The complete documentation is available - ');
  1038.       AddLine(' all 20 chapters plus the flash cards. That''s more than'); 
  1039.       AddLine(' 350 pages in total.');
  1040.       AddLine('');
  1041.       AddLine(' The files end with a TXT extension, and include formfeed');
  1042.       AddLine(' characters at least every 60 lines. To print them, copy');
  1043.       AddLine(' the files to the printer port, or import them into a word ');
  1044.       AddLine(' processor. You can even use the IDE to print them by ');
  1045.       AddLine(' marking a block and pressing Ctrl-KP.');
  1046.       AddLine('');
  1047.       Show;
  1048.       Done;
  1049.    end;
  1050. end; {PrintOption}
  1051. {|||||||||||||||||||||||||}
  1052. {                         }
  1053. {     O p t i o n   11    }
  1054. {                         }
  1055. {|||||||||||||||||||||||||}
  1056. procedure PurchaseOption;
  1057. {}
  1058. begin
  1059.    with Screen do
  1060.    begin
  1061.       TitledBox(1,1,80,25,27,30,23,2,' How to buy the Toolkit ');
  1062.       WritePlain(7,3,'If you have not yet purchased the Toolkit, you are welcome to use it');
  1063.       WritePlain(7,4,'for a few weeks to see if you like it. If you want to continue to use');
  1064.       WritePlain(7,5,'The Toolkit, you must buy your own copy - just like you bought Turbo ');
  1065.       WritePlain(7,6,'Pascal. Not only will you be able to use the Toolkit in your programs,');
  1066.       WritePlain(7,7,'you will receive two bound professional manuals, a quick reference');
  1067.       WritePlain(7,8,'card, the latest version of the product, and you''ll get technical');
  1068.       WritePlain(7,9,'support.');
  1069.       WritePlain(7,11,'Included in the Toolkit files should be a file REGISTER.DOC. This file');
  1070.       WritePlain(7,12,'provides all the information you need to order your copy. If this file');
  1071.       WritePlain(7,13,'is missing, or you have any questions or comments, please don''t ');
  1072.       WritePlain(7,14,'hesitate to contact us. ');
  1073.       WriteAT(25,16,30,'TechnoJock Software, Inc.');
  1074.       WriteAT(25,17,30,'PO Box 820927');
  1075.       WriteAT(25,18,30,'Houston TX 77282');
  1076.       WriteAT(25,19,30,'USA');
  1077.       WriteAT(25,21,30,'Voice (713) 493-6354');
  1078.       WriteAT(25,22,30,'Fax   (713) 493-5872');
  1079.       WriteAT(25,23,30,'Compuserve 74017,227');
  1080.       WriteAT(25,24,30,'MCI Mail: TECHNOJOCK');
  1081.       WriteRight(78,25,27,' Press any key to continue ... ');
  1082.    end;
  1083.    Key.GetInput;
  1084. end; {PurchaseOption}
  1085. {|||||||||||||||||||||||||||||||||}
  1086. {                                 }
  1087. {     M a i n   P r o g r a m     }
  1088. {                                 }
  1089. {|||||||||||||||||||||||||||||||||}
  1090.  
  1091. begin  {main program}
  1092.    if MemAvail < 20000 then
  1093.    begin
  1094.       ResetStartUpMode;
  1095.       writeln('OOPS. You don''t have enough memory to run the demo!');
  1096.       writeln('Try running the program from the DOS prompt.');
  1097.       halt(1);
  1098.    end;  
  1099.    Screen.Clear(white,' ');
  1100.    SaveScreen.Init;
  1101.    Key.SetFast;
  1102.    Introduction;
  1103.    SetUpMenu;
  1104.    SaveScreen.Save;
  1105.    repeat
  1106.       SaveScreen.Display;
  1107.       Choice := MainMenu.Activate;
  1108.       SaveScreen.Save;
  1109.       Screen.ResetWindow;
  1110.       case Choice of
  1111.          1: IntroOption;
  1112.          2: FormOption;
  1113.          3: DirectoryOption;
  1114.          4: BrowseListOption;
  1115.          5: MenuOption;
  1116.          6: StringDateOption;
  1117.          7: HardwareOption;
  1118.          8: InternationalOption;
  1119.          9: ReadmeOption;
  1120.          10: PrintOption;
  1121.          11: PurchaseOption;
  1122.       end; {case}
  1123.    until Choice in [0,99];
  1124.    Mouse.Hide;
  1125.    SaveScreen.Done;
  1126.    ResetStartUpMode;
  1127. end.
  1128.